<%-------------------------------------------------------------------
 * 页面名称：select_email.jsp
 * 功能描述：选择账户弹出页面
 * Action  : 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="cn.agiledata.bank.common.util.Constant" %>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
    String path = request.getContextPath();
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Pragma" content="no-cache" />
<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/font.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/newstyle.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/css/common.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='<%=path%>/js/vnv/commonForManage.js'></script>
<script language="JavaScript">
<!-- 
function closePage(){
    window.parent.closeLayer();
}
function submitDatas(obj)
{
    var result=new Array();
    var theTrRadio=obj.getElementsByTagName("INPUT");
    if (theTrRadio[0].tagName!=null&&(theTrRadio[0].type=="radio"||theTrRadio[0].type=="checkbox")) {
        result[0] = theTrRadio[0].client_id;
        result[1] = theTrRadio[0].client_name_l;
        window.parent.closeLayer(result,"email");
        return;
    }
    alert("请选择一条记录!");
}
 
function setCheck(obj) {    //
    var theTrRadio=obj.getElementsByTagName("INPUT");
    if (theTrRadio[0].tagName!=null&&(theTrRadio[0].type=="radio"||theTrRadio[0].type=="checkbox")) {
        //setButtonsOnClick(theTrRadio[0]);theTrRadio[0].checked=true;
        theTrRadio[0].click();
    }
}

function submitDatas()
{
    var result=new Array();
    var stack=getRadioGroup("client_info");
    for(var i=0;i<stack.length;i++)
    {
        if(stack[i].checked)
        {
            result[0]=stack[i].client_id;
            result[1]=stack[i].client_name_l;
            window.parent.closeLayer(result,"email");
            return;
        }
    }
    alert("请选择一条记录!");
}
//-->
</script>

<form  name='frm' method='get'>
<table border="0" cellpadding="0" cellspacing="0" >
<tr><td>
<table border="0" cellpadding="5" cellspacing="1" >
  <tr>
    <td bgcolor="#FFFFFF">
    <table width="100%">
      <tr>
        <th height="25" bgcolor="#BFDBF3">&nbsp;</td>
        <th bgcolor="#BFDBF3">账户名称</td>
        <th bgcolor="#BFDBF3">email</td>  
        <th bgcolor="#BFDBF3">手机号码</td>
        <th bgcolor="#BFDBF3">列表类别</td>
      </tr>
      <c:forEach var="element" items="${list.data}" varStatus="status">
      <c:if test="${status.index % 2 == 0}"><tr height="28" onDblClick="submitDatas(this)" onClick="setCheck(this)" align="center" class="tableWhiteBg"></c:if>
      <c:if test="${status.index % 2 == 1}"><tr height="28" onDblClick="submitDatas(this)" onClick="setCheck(this)" align="center" class="tableBlueBg"></c:if>
        <td bgcolor="#F0F9FE">
            <input type="radio" name="client_info" client_id='<bean:write name="element" property="value"/>' 
                client_name_l='<bean:write name="element" property="value"/>' style="border:0" />
        </td>
        <td bgcolor="#F0F9FE"><bean:write name="element" property="name"/></td>
        <td bgcolor="#F0F9FE"><bean:write name="element" property="email"/></td>
        <td bgcolor="#F0F9FE"><bean:write name="element" property="mobile"/></td>
        <td bgcolor="#F0F9FE">
            <logic:match name="element" property="type" value="<%=Constant.PEER_ACCOUNT_SOURCE_PREPARATIVE%>">联系人</logic:match>
            <logic:match name="element" property="type" value="<%=Constant.PEER_ACCOUNT_SOURCE_TRANSACTED%>">交易过账户</logic:match>
        </td>
      </tr>
      </c:forEach>
    </table>
	<table width="100%">
	<tr>
        <td>
        <ad:PageBean name="list" ></ad:PageBean>
        </td>
      </tr>
	</table>
    </td>
  </tr>
</table>
</td></tr>
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="41" align="center">
        <input type="button" value="确定" class="button_style" onclick="submitDatas();" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" value="取消" class="button_style" onclick="closePage();" />
    </td>
  </tr>
</table>
</td></tr>
</table>
</form>
<script type="text/javascript">
window.parent.showLayer(window);
</script>
